local file = io.open(arg[1],"rb");
assert(file);

local a,b;
local list = {};
local ii = table.insert;
for line in file:lines()do
    local m = line:match('^%s*;');
    if(not m)then
        line = line:match('([^;]+)');
        if(not a)then
            a=line;
        else
            b=line;
        end
        if(b)then
            ii(list,{a,b});
            a = nil;
            b = nil;
        end
    end
end

--print(#list);

for k,line in ipairs(list)do
    --处理指令字节
    local insn_array = '';
    local pc_array = '';
    for hex in line[1]:gmatch('(%w+)')do
        insn_array = insn_array .. hex .. ' '
    end

    for hex in line[2]:gmatch('(%w+)')do
        pc_array = pc_array .. hex .. ' '
    end

    print(pc_array);

end
